﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KnBinarySerializer.Tests
{
    internal class TableHelper
    {
        public static DataTable BuildTable(string name)
        {
            DataTable table = new DataTable();
            table.TableName = name;
            table.Columns.Add("Name", typeof(string));
            table.Columns.Add("Sex", typeof(object));
            table.Columns.Add("Age", typeof(short));
            table.Columns.Add("Address", typeof(string));
            for (int i = 0; i < 10; i++)
            {
                DataRow dataRow = table.NewRow();
                dataRow["Name"] = name + i;
                dataRow["Sex"] = "ll";
                dataRow["Age"] = i;
                table.Rows.Add(dataRow);
            }
            table.AcceptChanges();
            table.Rows[0]["Sex"] = "男/女";
            return table;
        }
    }
}
